home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / Other Langs / MacPerl ƒ / Perl Source ƒ / MacPerl / lib / macperldb.pl < prev    next >
Perl Script  |  1993-10-23  |  16KB  |  587 lines

  1. package DB;
  2.  
  3. # modified Perl debugger, to be run from Emacs in perldb-mode
  4. # Ray Lischner (uunet!mntgfx!lisch) as of 5 Nov 1990
  5. # Johan Vromans -- upgrade to 4.0 pl 10
  6.  
  7. $header = '$RCSfile: perldb.pl,v $$Revision: 4.0.1.3 $$Date: 92/06/08 13:43:57 $';
  8. #
  9. # This file is automatically included if you do perl -d.
  10. # It's probably not useful to include this yourself.
  11. #
  12. # Perl supplies the values for @line and %sub.  It effectively inserts
  13. # a do DB'DB(<linenum>); in front of every place that can
  14. # have a breakpoint.  It also inserts a do 'perldb.pl' before the first line.
  15. #
  16. # $Log:    perldb.pl,v $
  17. # Revision 4.0.1.3  92/06/08  13:43:57  lwall
  18. # patch20: support for MSDOS folded into perldb.pl
  19. # patch20: perldb couldn't debug file containing '-', such as STDIN designator
  20. # Revision 4.0.1.2  91/11/05  17:55:58  lwall
  21. # patch11: perldb.pl modified to run within emacs in perldb-mode
  22. # Revision 4.0.1.1  91/06/07  11:17:44  lwall
  23. # patch4: added $^P variable to control calling of perldb routines
  24. # patch4: debugger sometimes listed wrong number of lines for a statement
  25. # Revision 4.0  91/03/20  01:25:50  lwall
  26. # 4.0 baseline.
  27. # Revision 3.0.1.6  91/01/11  18:08:58  lwall
  28. # patch42: @_ couldn't be accessed from debugger
  29. # Revision 3.0.1.5  90/11/10  01:40:26  lwall
  30. # patch38: the debugger wouldn't stop correctly or do action routines
  31. # Revision 3.0.1.4  90/10/15  17:40:38  lwall
  32. # patch29: added caller
  33. # patch29: the debugger now understands packages and evals
  34. # patch29: scripts now run at almost full speed under the debugger
  35. # patch29: more variables are settable from debugger
  36. # Revision 3.0.1.3  90/08/09  04:00:58  lwall
  37. # patch19: debugger now allows continuation lines
  38. # patch19: debugger can now dump lists of variables
  39. # patch19: debugger can now add aliases easily from prompt
  40. # Revision 3.0.1.2  90/03/12  16:39:39  lwall
  41. # patch13: perl -d didn't format stack traces of *foo right
  42. # patch13: perl -d wiped out scalar return values of subroutines
  43. # Revision 3.0.1.1  89/10/26  23:14:02  lwall
  44. # patch1: RCS expanded an unintended $Header in lib/perldb.pl
  45. # Revision 3.0  89/10/18  15:19:46  lwall
  46. # 3.0 baseline
  47. # Revision 2.0  88/06/05  00:09:45  root
  48. # Baseline version 2.0.
  49. #
  50.  
  51. $console = "Dev:Console:Perl Debug";
  52. $rcfile=".perldb";
  53.  
  54. open(IN, "<$console") || open(IN,  "<&STDIN");    # so we don't dingle stdin
  55. open(OUT,">$console") || open(OUT, ">&STDOUT");    # so we don't dongle stdout
  56. select(OUT);
  57. $| = 1;                # for DB'OUT
  58. select(STDOUT);
  59. $| = 1;                # for real STDOUT
  60. $sub = '';
  61.  
  62. $header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
  63. print OUT "\nLoading DB routines from $header\n";
  64. print OUT "\nEnter h for help.\n\n";
  65.  
  66. sub DB {
  67.     &save;
  68.     ($package, $filename, $line) = caller;
  69.     $usercontext = '($@, $!, $[, $,, $/, $\) = @saved;' .
  70.     "package $package;";        # this won't let them modify, alas
  71.     local($^P) = 0;            # don't debug our own evals
  72.     local(*dbline) = "_<$filename";
  73.     $max = $#dbline;
  74.     if (($stop,$action) = split(/\0/,$dbline{$line})) {
  75.     if ($stop eq '1') {
  76.         $signal |= 1;
  77.     }
  78.     else {
  79.         $evalarg = "\$DB'signal |= do {$stop;}"; &eval;
  80.         $dbline{$line} =~ s/;9($|\0)/$1/;
  81.     }
  82.     }
  83.     if ($single || $trace || $signal) {
  84.     if ($emacs) {
  85.         print OUT "\032\032$filename:$line:0\n";
  86.     } else {
  87.         print OUT "$package'" unless $sub =~ /'/;
  88.         print OUT "$sub($filename:$line):\t",$dbline[$line];
  89.         for ($i = $line + 1; $i <= $max && $dbline[$i] == 0; ++$i) {
  90.         last if $dbline[$i] =~ /^\s*(}|#|\n)/;
  91.         print OUT "$sub($filename:$i):\t",$dbline[$i];
  92.         }
  93.     }
  94.     }
  95.     $evalarg = $action, &eval if $action;
  96.     if ($single || $signal) {
  97.     $evalarg = $pre, &eval if $pre;
  98.     print OUT $#stack . " levels deep in subroutine calls!\n"
  99.         if $single & 4;
  100.     $start = $line;
  101.       CMD:
  102.     while ((print OUT "  DB<", $#hist+1, "> "), $cmd=&gets) {
  103.         {
  104.         $single = 0;
  105.         $signal = 0;
  106.         $cmd eq '' && exit 0;
  107.         chop($cmd);
  108.         # This will remove the prompt picked up by MPW
  109.         $tmp_prompt = "  DB<" . ($#hist + 1) . "> ";
  110.         $cmd =~ s/^$tmp_prompt(.*)$/\1/;
  111.         # MPW Removal ended...
  112.         $cmd =~ s/\\$// && do {
  113.             print OUT "  cont: ";
  114.             $cmd .= &gets;
  115.             redo CMD;
  116.         };
  117.         $cmd =~ /^q$/ && exit 0;
  118.         $cmd =~ /^$/ && ($cmd = $laststep);
  119.         push(@hist,$cmd) if length($cmd) > 1;
  120.         ($i) = split(/\s+/,$cmd);
  121.         eval "\$cmd =~ $alias{$i}", print OUT $@ if $alias{$i};
  122.         $cmd =~ /^h$/ && do {
  123.             print OUT "
  124. T        Stack trace.
  125. s        Single step.
  126. n        Next, steps over subroutine calls.
  127. r        Return from current subroutine.
  128. c [line]    Continue; optionally inserts a one-time-only breakpoint 
  129.         at the specified line.
  130. <CR>        Repeat last n or s.
  131. l min+incr    List incr+1 lines starting at min.
  132. l min-max    List lines.
  133. l line        List line;
  134. l        List next window.
  135. -        List previous window.
  136. w line        List window around line.
  137. l subname    List subroutine.
  138. f filename    Switch to filename.
  139. /pattern/    Search forwards for pattern; final / is optional.
  140. ?pattern?    Search backwards for pattern.
  141. L        List breakpoints and actions.
  142. S        List subroutine names.
  143. t        Toggle trace mode.
  144. b [line] [condition]
  145.         Set breakpoint; line defaults to the current execution line; 
  146.         condition breaks if it evaluates to true, defaults to \'1\'.
  147. b subname [condition]
  148.         Set breakpoint at first line of subroutine.
  149. d [line]    Delete breakpoint.
  150. D        Delete all breakpoints.
  151. a [line] command
  152.         Set an action to be done before the line is executed.
  153.         Sequence is: check for breakpoint, print line if necessary,
  154.         do action, prompt user if breakpoint or step, evaluate line.
  155. A        Delete all actions.
  156. V [pkg [vars]]    List some (default all) variables in package (default current).
  157. X [vars]    Same as \"V currentpackage [vars]\".
  158. < command    Define command before prompt.
  159. > command    Define command after prompt.
  160. ! number    Redo command (default previous command).
  161. ! -number    Redo number\'th to last command.
  162. H -number    Display last number commands (default all).
  163. q or ^D        Quit.
  164. p expr        Same as \"print DB'OUT expr\" in current package.
  165. = [alias value]    Define a command alias, or list current aliases.
  166. command        Execute as a perl statement in current package.
  167.  
  168. ";
  169.             next CMD; };
  170.         $cmd =~ /^t$/ && do {
  171.             $trace = !$trace;
  172.             print OUT "Trace = ".($trace?"on":"off")."\n";
  173.             next CMD; };
  174.         $cmd =~ /^S$/ && do {
  175.             foreach $subname (sort(keys %sub)) {
  176.             print OUT $subname,"\n";
  177.             }
  178.             next CMD; };
  179.         $cmd =~ s/^X\b/V $package/;
  180.         $cmd =~ /^V$/ && do {
  181.             $cmd = 'V $package'; };
  182.         $cmd =~ /^V\b\s*(\S+)\s*(.*)/ && do {
  183.             $packname = $1;
  184.             @vars = split(' ',$2);
  185.             do 'dumpvar.pl' unless defined &main'dumpvar;
  186.             if (defined &main'dumpvar) {
  187.             &main'dumpvar($packname,@vars);
  188.             }
  189.             else {
  190.             print DB'OUT "dumpvar.pl not available.\n";
  191.             }
  192.             next CMD; };
  193.         $cmd =~ /^f\b\s*(.*)/ && do {
  194.             $file = $1;
  195.             if (!$file) {
  196.             print OUT "The old f command is now the r command.\n";
  197.             print OUT "The new f command switches filenames.\n";
  198.             next CMD;
  199.             }
  200.             if (!defined $_main{'_<' . $file}) {
  201.             if (($try) = grep(m#^_<.*$file#, keys %_main)) {
  202.                 $file = substr($try,2);
  203.                 print "\n$file:\n";
  204.             }
  205.             }
  206.             if (!defined $_main{'_<' . $file}) {
  207.             print OUT "There's no code here anything matching $file.\n";
  208.             next CMD;
  209.             }
  210.             elsif ($file ne $filename) {
  211.             *dbline = "_<$file";
  212.             $max = $#dbline;
  213.             $filename = $file;
  214.             $start = 1;
  215.             $cmd = "l";
  216.             } };
  217.         $cmd =~ /^l\b\s*(['A-Za-z_]['\w]*)/ && do {
  218.             $subname = $1;
  219.             $subname = "main'" . $subname unless $subname =~ /'/;
  220.             $subname = "main" . $subname if substr($subname,0,1) eq "'";
  221.             ($file,$subrange) = split(/:/,$sub{$subname});
  222.             if ($file ne $filename) {
  223.             *dbline = "_<$file";
  224.             $max = $#dbline;
  225.             $filename = $file;
  226.             }
  227.             if ($subrange) {
  228.             if (eval($subrange) < -$window) {
  229.                 $subrange =~ s/-.*/+/;
  230.             }
  231.             $cmd = "l $subrange";
  232.             } else {
  233.             print OUT "Subroutine $1 not found.\n";
  234.             next CMD;
  235.             } };
  236.         $cmd =~ /^w\b\s*(\d*)$/ && do {
  237.             $incr = $window - 1;
  238.             $start = $1 if $1;
  239.             $start -= $preview;
  240.             $cmd = 'l ' . $start . '-' . ($start + $incr); };
  241.         $cmd =~ /^-$/ && do {
  242.             $incr = $window - 1;
  243.             $cmd = 'l ' . ($start-$window*2) . '+'; };
  244.         $cmd =~ /^l$/ && do {
  245.             $incr = $window - 1;
  246.             $cmd = 'l ' . $start . '-' . ($start + $incr); };
  247.         $cmd =~ /^l\b\s*(\d*)\+(\d*)$/ && do {
  248.             $start = $1 if $1;
  249.             $incr = $2;
  250.             $incr = $window - 1 unless $incr;
  251.             $cmd = 'l ' . $start . '-' . ($start + $incr); };
  252.         $cmd =~ /^l\b\s*(([\d\$\.]+)([-,]([\d\$\.]+))?)?/ && do {
  253.             $end = (!$2) ? $max : ($4 ? $4 : $2);
  254.             $end = $max if $end > $max;
  255.             $i = $2;
  256.             $i = $line if $i eq '.';
  257.             $i = 1 if $i < 1;
  258.             if ($emacs) {
  259.             print OUT "\032\032$filename:$i:0\n";
  260.             $i = $end;
  261.             } else {
  262.             for (; $i <= $end; $i++) {
  263.                 print OUT "$i:\t", $dbline[$i];
  264.                 last if $signal;
  265.             }
  266.             }
  267.             $start = $i;    # remember in case they want more
  268.             $start = $max if $start > $max;
  269.             next CMD; };
  270.         $cmd =~ /^D$/ && do {
  271.             print OUT "Deleting all breakpoints...\n";
  272.             for ($i = 1; $i <= $max ; $i++) {
  273.             if (defined $dbline{$i}) {
  274.                 $dbline{$i} =~ s/^[^\0]+//;
  275.                 if ($dbline{$i} =~ s/^\0?$//) {
  276.                 delete $dbline{$i};
  277.                 }
  278.             }
  279.             }
  280.             next CMD; };
  281.         $cmd =~ /^L$/ && do {
  282.             for ($i = 1; $i <= $max; $i++) {
  283.             if (defined $dbline{$i}) {
  284.                 print OUT "$i:\t", $dbline[$i];
  285.                 ($stop,$action) = split(/\0/, $dbline{$i});
  286.                 print OUT "  break if (", $stop, ")\n" 
  287.                 if $stop;
  288.                 print OUT "  action:  ", $action, "\n" 
  289.                 if $action;
  290.                 last if $signal;
  291.             }
  292.             }
  293.             next CMD; };
  294.         $cmd =~ /^b\b\s*(['A-Za-z_]['\w]*)\s*(.*)/ && do {
  295.             $subname = $1;
  296.             $cond = $2 || '1';
  297.             $subname = "$package'" . $subname unless $subname =~ /'/;
  298.             $subname = "main" . $subname if substr($subname,0,1) eq "'";
  299.             ($filename,$i) = split(/:/, $sub{$subname});
  300.             $i += 0;
  301.             if ($i) {
  302.             *dbline = "_<$filename";
  303.             ++$i while $dbline[$i] == 0 && $i < $#dbline;
  304.             $dbline{$i} =~ s/^[^\0]*/$cond/;
  305.             } else {
  306.             print OUT "Subroutine $subname not found.\n";
  307.             }
  308.             next CMD; };
  309.         $cmd =~ /^b\b\s*(\d*)\s*(.*)/ && do {
  310.             $i = ($1?$1:$line);
  311.             $cond = $2 || '1';
  312.             if ($dbline[$i] == 0) {
  313.             print OUT "Line $i not breakable.\n";
  314.             } else {
  315.             $dbline{$i} =~ s/^[^\0]*/$cond/;
  316.             }
  317.             next CMD; };
  318.         $cmd =~ /^d\b\s*(\d+)?/ && do {
  319.             $i = ($1?$1:$line);
  320.             $dbline{$i} =~ s/^[^\0]*//;
  321.             delete $dbline{$i} if $dbline{$i} eq '';
  322.             next CMD; };
  323.         $cmd =~ /^A$/ && do {
  324.             for ($i = 1; $i <= $max ; $i++) {
  325.             if (defined $dbline{$i}) {
  326.                 $dbline{$i} =~ s/\0[^\0]*//;
  327.                 delete $dbline{$i} if $dbline{$i} eq '';
  328.             }
  329.             }
  330.             next CMD; };
  331.         $cmd =~ /^<\s*(.*)/ && do {
  332.             $pre = do action($1);
  333.             next CMD; };
  334.         $cmd =~ /^>\s*(.*)/ && do {
  335.             $post = do action($1);
  336.             next CMD; };
  337.         $cmd =~ /^a\b\s*(\d+)(\s+(.*))?/ && do {
  338.             $i = $1;
  339.             if ($dbline[$i] == 0) {
  340.             print OUT "Line $i may not have an action.\n";
  341.             } else {
  342.             $dbline{$i} =~ s/\0[^\0]*//;
  343.             $dbline{$i} .= "\0" . do action($3);
  344.             }
  345.             next CMD; };
  346.         $cmd =~ /^n$/ && do {
  347.             $single = 2;
  348.             $laststep = $cmd;
  349.             last CMD; };
  350.         $cmd =~ /^s$/ && do {
  351.             $single = 1;
  352.             $laststep = $cmd;
  353.             last CMD; };
  354.         $cmd =~ /^c\b\s*(\d*)\s*$/ && do {
  355.             $i = $1;
  356.             if ($i) {
  357.             if ($dbline[$i] == 0) {
  358.                 print OUT "Line $i not breakable.\n";
  359.                 next CMD;
  360.             }
  361.             $dbline{$i} =~ s/(\0|$)/;9$1/;    # add one-time-only b.p.
  362.             }
  363.             for ($i=0; $i <= $#stack; ) {
  364.             $stack[$i++] &= ~1;
  365.             }
  366.             last CMD; };
  367.         $cmd =~ /^r$/ && do {
  368.             $stack[$#stack] |= 2;
  369.             last CMD; };
  370.         $cmd =~ /^T$/ && do {
  371.             local($p,$f,$l,$s,$h,$a,@a,@sub);
  372.             for ($i = 1; ($p,$f,$l,$s,$h,$w) = caller($i); $i++) {
  373.             @a = @args;
  374.             for (@a) {
  375.                 if (/^StB\000/ && length($_) == length($_main{'_main'})) {
  376.                 $_ = sprintf("%s",$_);
  377.                 }
  378.                 else {
  379.                 s/'/\\'/g;
  380.                 s/([^\0]*)/'$1'/ unless /^-?[\d.]+$/;
  381.                 s/([\200-\377])/sprintf("M-%c",ord($1)&0177)/eg;
  382.                 s/([\0-\37\177])/sprintf("^%c",ord($1)^64)/eg;
  383.                 }
  384.             }
  385.             $w = $w ? '@ = ' : '$ = ';
  386.             $a = $h ? '(' . join(', ', @a) . ')' : '';
  387.             push(@sub, "$w&$s$a from file $f line $l\n");
  388.             last if $signal;
  389.             }
  390.             for ($i=0; $i <= $#sub; $i++) {
  391.             last if $signal;
  392.             print OUT $sub[$i];
  393.             }
  394.             next CMD; };
  395.         $cmd =~ /^\/(.*)$/ && do {
  396.             $inpat = $1;
  397.             $inpat =~ s:([^\\])/$:$1:;
  398.             if ($inpat ne "") {
  399.             eval '$inpat =~ m'."\n$inpat\n";    
  400.             if ($@ ne "") {
  401.                 print OUT "$@";
  402.                 next CMD;
  403.             }
  404.             $pat = $inpat;
  405.             }
  406.             $end = $start;
  407.             eval '
  408.             for (;;) {
  409.             ++$start;
  410.             $start = 1 if ($start > $max);
  411.             last if ($start == $end);
  412.             if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  413.                 if ($emacs) {
  414.                 print OUT "\032\032$filename:$start:0\n";
  415.                 } else {
  416.                 print OUT "$start:\t", $dbline[$start], "\n";
  417.                 }
  418.                 last;
  419.             }
  420.             } ';
  421.             print OUT "/$pat/: not found\n" if ($start == $end);
  422.             next CMD; };
  423.         $cmd =~ /^\?(.*)$/ && do {
  424.             $inpat = $1;
  425.             $inpat =~ s:([^\\])\?$:$1:;
  426.             if ($inpat ne "") {
  427.             eval '$inpat =~ m'."\n$inpat\n";    
  428.             if ($@ ne "") {
  429.                 print OUT "$@";
  430.                 next CMD;
  431.             }
  432.             $pat = $inpat;
  433.             }
  434.             $end = $start;
  435.             eval '
  436.             for (;;) {
  437.             --$start;
  438.             $start = $max if ($start <= 0);
  439.             last if ($start == $end);
  440.             if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  441.                 if ($emacs) {
  442.                 print OUT "\032\032$filename:$start:0\n";
  443.                 } else {
  444.                 print OUT "$start:\t", $dbline[$start], "\n";
  445.                 }
  446.                 last;
  447.             }
  448.             } ';
  449.             print OUT "?$pat?: not found\n" if ($start == $end);
  450.             next CMD; };
  451.         $cmd =~ /^!+\s*(-)?(\d+)?$/ && do {
  452.             pop(@hist) if length($cmd) > 1;
  453.             $i = ($1?($#hist-($2?$2:1)):($2?$2:$#hist));
  454.             $cmd = $hist[$i] . "\n";
  455.             print OUT $cmd;
  456.             redo CMD; };
  457.         $cmd =~ /^!(.+)$/ && do {
  458.             $pat = "^$1";
  459.             pop(@hist) if length($cmd) > 1;
  460.             for ($i = $#hist; $i; --$i) {
  461.             last if $hist[$i] =~ $pat;
  462.             }
  463.             if (!$i) {
  464.             print OUT "No such command!\n\n";
  465.             next CMD;
  466.             }
  467.             $cmd = $hist[$i] . "\n";
  468.             print OUT $cmd;
  469.             redo CMD; };
  470.         $cmd =~ /^H\b\s*(-(\d+))?/ && do {
  471.             $end = $2?($#hist-$2):0;
  472.             $hist = 0 if $hist < 0;
  473.             for ($i=$#hist; $i>$end; $i--) {
  474.             print OUT "$i: ",$hist[$i],"\n"
  475.                 unless $hist[$i] =~ /^.?$/;
  476.             };
  477.             next CMD; };
  478.         $cmd =~ s/^p( .*)?$/print DB'OUT$1/;
  479.         $cmd =~ /^=/ && do {
  480.             if (local($k,$v) = ($cmd =~ /^=\s*(\S+)\s+(.*)/)) {
  481.             $alias{$k}="s~$k~$v~";
  482.             print OUT "$k = $v\n";
  483.             } elsif ($cmd =~ /^=\s*$/) {
  484.             foreach $k (sort keys(%alias)) {
  485.                 if (($v = $alias{$k}) =~ s~^s\~$k\~(.*)\~$~$1~) {
  486.                 print OUT "$k = $v\n";
  487.                 } else {
  488.                 print OUT "$k\t$alias{$k}\n";
  489.                 };
  490.             };
  491.             };
  492.             next CMD; };
  493.         }
  494.         $evalarg = $cmd; &eval;
  495.         print OUT "\n";
  496.     }
  497.     if ($post) {
  498.         $evalarg = $post; &eval;
  499.     }
  500.     }
  501.     ($@, $!, $[, $,, $/, $\) = @saved;
  502. }
  503.  
  504. sub save {
  505.     @saved = ($@, $!, $[, $,, $/, $\);
  506.     $[ = 0; $, = ""; $/ = "\n"; $\ = "";
  507. }
  508.  
  509. # The following takes its argument via $evalarg to preserve current @_
  510.  
  511. sub eval {
  512.     eval "$usercontext $evalarg; &DB'save";
  513.     print OUT $@;
  514. }
  515.  
  516. sub action {
  517.     local($action) = @_;
  518.     while ($action =~ s/\\$//) {
  519.     print OUT "+ ";
  520.     $action .= &gets;
  521.     }
  522.     $action;
  523. }
  524.  
  525. sub gets {
  526.     local($.);
  527.     <IN>;
  528. }
  529.  
  530. sub catch {
  531.     $signal = 1;
  532. }
  533.  
  534. sub sub {
  535.     push(@stack, $single);
  536.     $single &= 1;
  537.     $single |= 4 if $#stack == $deep;
  538.     if (wantarray) {
  539.     @i = &$sub;
  540.     $single |= pop(@stack);
  541.     @i;
  542.     }
  543.     else {
  544.     $i = &$sub;
  545.     $single |= pop(@stack);
  546.     $i;
  547.     }
  548. }
  549.  
  550. $single = 1;            # so it stops on first executable statement
  551. @hist = ('?');
  552. $SIG{'INT'} = "DB'catch";
  553. $deep = 100;        # warning if stack gets this deep
  554. $window = 10;
  555. $preview = 3;
  556.  
  557. @stack = (0);
  558. @ARGS = @ARGV;
  559. for (@args) {
  560.     s/'/\\'/g;
  561.     s/(.*)/'$1'/ unless /^-?[\d.]+$/;
  562. }
  563.  
  564. if (-f $rcfile) {
  565.     do ':$rcfile';
  566. }
  567. elsif (-f "$ENV{'MPW'}:$rcfile") {
  568.     do "$ENV{'MPW'}:$rcfile";
  569. }
  570. elsif (-f "$ENV{'HOME'}:$rcfile") {
  571.     do "$ENV{'HOME'}:$rcfile";
  572. }
  573.  
  574. 1;
  575.